package router

import (
	middlewares "mdgg/app/admin/middleware"

	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/net/ghttp"
)

type Router struct{}

// 统一路由注册.
func init() {
	s := g.Server()
	s.EnableAdmin("/mdgg/debug")
	s.Use(middlewares.CORS)
	group := s.Group("/")
	//上传的文件允许跨域请求
	group.Hook("/pub_upload/*", ghttp.HOOK_BEFORE_SERVE, func(r *ghttp.Request) {
		r.Response.CORSDefault()
	})
}
